<template>
	<view>
		<!-- 我的 -->
		<!-- 未登录： -->
		<template v-if="islogin">
			<view class="me-login-title">登录仿糗事百科，体验更多功能</view>
			<otherLogin></otherLogin>
			<view class="me-login" @tap="toLogin">
				账号密码登录
				<view class="icon iconfont icon-jinru"></view>
			</view>
		</template>
		<view class="login-box" v-else>
			<view class="login-box-user">
				<view>
					<image src="../../static/img/demo6.jpg" mode="widthFix"></image>
				</view>
				<view>
					<view>初非</view>
					<view>总访客 0 今日 0</view>
				</view>
			</view>
			<view class="icon iconfont icon-jinru login-box-r"></view>

		</view>

		<view class="me-navbar">
			<view class="me-navbar-item" v-for="(item,index) in meNavbar" :key="index">
				<view>{{item.number}}</view>
				<view>{{item.name}}</view>
			</view>
		</view>
		<view class="me-img">
			<image src="../../static/img/demo20.jpg" mode="widthFix"></image>
		</view>
		<view class="me-list">
			<block v-for="(item,index) in melist" :key="index">
				<meList :item="item"></meList>
			</block>
		</view>
	</view>
</template>

<script>
	import meList from '../../components/me/me-list.vue';
	import otherLogin from '../../components/me/other-login.vue';
	
	export default {
		data() {
			return {
				islogin: true,
				meNavbar:[
					{
						number:0,
						name:'糗事'
					},
					{
						number:0,
						name:'动态'
					},
					{
						number:0,
						name:'评论'
					},
					{
						number:0,
						name:'收藏'
					}
				],
				melist: [{
						zclass: 'liulan',
						colorClass: 'icon-history',
						name: '浏览历史',
						url: '',
						linkType: 'navigateTo'
					},
					{
						zclass: 'huiyuanvip',
						colorClass: 'icon-rz',
						name: '糗百认证',
						url: '',
						linkType: 'navigateTo'
					},
					{
							zclass: 'liulan',
							colorClass: 'icon-history',
							name: '浏览历史',
							url: '',
							linkType: 'navigateTo'
						},
				]
			}
		},
		components: {
			meList,
			otherLogin
		},
		onNavigationBarButtonTap(e) {
			console.log(e)
			if(e.index==0){
				this.user.navigate({url: 'me-setting'})
			}
		},
		methods: {
			toLogin(){
				uni.navigateTo({
					url: '../login/login',
				});
			}
		}
	}
</script>

<style scoped lang="scss">
	.me-login-title {
		padding: 20upx 0;
		text-align: center;
	}

	

	.me-login {
		display: flex;
		align-items: center;
		padding: 20upx 0;
		justify-content: center;

		&>view {
			padding: 0 10upx;
			color: #D5D5D5;
		}
	}

	.login-box {
		display: flex;
		align-items: center;
		justify-content: space-between;

		.login-box-user {
			flex: 1;
			display: flex;
			align-items: center;
			padding-left: 20upx;

			&>view:first-child {
				width: 100upx;
				height: 100upx;

				image {
					width: 100%;
					height: 100upx;
					border-radius: 100%;
					border: 1px solid;
				}
			}

			&>view:nth-of-type(2) {

				padding: 0 20upx;

				&>view:first-child {
					font-size: 30upx;
				}

				&>view:nth-of-type(2) {
					color: #D9D9D9;
					font-size: 25upx;
				}
			}
		}

		.login-box-r {
			width: 80upx;
		}
	}

	.me-navbar {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 20upx 80upx;
		text-align: center;

		.me-navbar-item {
			&>view:nth-of-type(2) {
				color: #D7D7D7;
			}

			&>view:nth-of-type(1) {
				color: #000;
				font-size: 35upx;
			}
		}


	}

	.me-img {
		width: 100%;
		height: 200upx;
		padding: 5upx 0;

		image {
			width: 100%;
			height: 100%;
			border-radius: 10px;
			padding: 5upx 0;
		}
	}

	.me-list {
		margin-top: 20upx;
	}

	
</style>
